<template>
  <div id="app">
    <el-container>
      <el-header v-show="$route.meta.isNotShowLogin">
        <topNav @quit="quit"></topNav>
      </el-header>
      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </div>
</template>


<script>
  import TopNav from '@/components/TopNav.vue'

  export default {
    data(){
      return{
        loginStatus: true
      }
    },
    components: {
      TopNav
    },
    methods:{
      quit(data){
        if(data){
          this.$confirm('是否确定退出?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            localStorage.clear();
            this.$router.push({ name: 'login' });
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消操作'
            });
          });
        }
      }
    }
  }
</script>

<style lang="scss">
  .el-header {
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  .el-main {
    color: #333;
  }
</style>
